import sys


g_size = 8
g_board = []
g_counter = []

def init_board():
    for i in range(0,g_size):
        g_board.append( g_size * [0] )

init_board()

def print_board():
    print("printing_board")
    for i in g_board:
        print(i)

def is_free( x, y ):
    return  0 <= x < g_size and 0 <= y < g_size and g_board[x][y] == 0

def move_knight( x,y,counter ):
#    print("moving knight %s, %s, %s" % (x,y,counter))
    if counter >= g_size * g_size:
        g_counter.append("1")
        print(len(g_counter))


    jumps = [[-2,1], [-1,2], [1,2], [2,1], [2,-1],[1,-2], [-1,-2], [-2,-1]]

    for jump in jumps:
        new_x = x + jump[0]
        new_y = y + jump[1]
        if is_free(new_x,new_y):
            g_board[new_x][new_y] = counter
            move_knight(new_x, new_y, counter+1)
            g_board[new_x][new_y] = 0


def play( x,y ):
    g_board[x][y]=1
    move_knight(x,y,2)

play(0,0)
print(len(g_counter))